package com.demo15;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;

public class InputStreamDemo4 {
    public static void main(String[] args) throws IOException {
        //字符串编码和解码的操作
        String str = "振涛教育";

        byte[] bys = str.getBytes("UTF-8");//编码，默认

        System.out.println(Arrays.toString(bys));


        //解码的操作
        String str1 = new String(bys,"UTF-8");

        System.out.println(str);
    }
}
